<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
<script src="../resources/picker-common.js"></script>
</head>
<body>
<select id="menu" style="position: absolute;">
  <option>o1</option>
  <option>o2</option>
</select>
<script>
var menu = document.getElementById('menu');
var picker;

function openPickerErrorCallback() {
  testFailed('picker didn\'t open')
  finishJSTest();
}
openPicker(menu, testPartiallyVisible, openPickerErrorCallback);

function testPartiallyVisible() {
  picker = internals.pagePopupWindow.global.picker;

  function onUpdate() {
    setTimeout(function() {
      shouldBeFalse('internals.pagePopupWindow.isWindowHidden()');
      picker.removeListener('didUpdate', onUpdate);
      finishJSTest();
    });
  }
  picker.on('didUpdate', onUpdate);
  menu.style.top = '-1px';
}
</script>
</body>
</html>
